package com.nightpiter.view.graphics.impl;

import android.graphics.Rect;

import com.nightpiter.view.graphics.abstaractions.AbstractRect;

public class AndroidRect implements AbstractRect {

	public static Rect cast(com.nightpiter.view.graphics.Rect aRect) {
		return ((AndroidRect) (aRect.getDelegate())).getRect();
	}

	private Rect rect;

	public AndroidRect(Rect rectangle) {
		this.rect = rectangle;
	}

	public int getBottom() {
		return rect.bottom;
	}

	public int getLeft() {
		return rect.left;
	}

	public int getRight() {
		return rect.right;
	}

	public int getTop() {
		return rect.top;
	}

	public int height() {
		return rect.height();
	}

	public int width() {
		return rect.width();
	}

	public void setBottom(int bottom) {
		rect.bottom = bottom;
	}

	public void setLeft(int left) {
		rect.left = left;
	}

	public void setRight(int right) {
		rect.right = right;
	}

	public void setTop(int top) {
		rect.top = top;
	}

	public boolean contains(int x, int y) {
		return rect.contains(x, y);
	}

	public boolean setIntersect(com.nightpiter.view.graphics.Rect a,
			com.nightpiter.view.graphics.Rect b) {
		return rect.setIntersect(AndroidRect.cast(a), AndroidRect.cast(b));
	}

	public boolean contains(com.nightpiter.view.graphics.Rect r) {
		return rect.contains(AndroidRect.cast(r));
	}

	public Rect getRect() {
		return rect;
	}

}
